<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <meta name="copyright" content=
    "Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css" />
    <title>
      Access Rules
    </title>
  </head>

  <body>
    <h1>
      Access Rules
    </h1>Access rules can be added to build classpath entries to specify which types in the given
    entry can be accessed and which not. If the compiler detects a type access to a type that
    should not be accessed, it will create a problem marker.
    <ul>
      <li>Non-accessible rules define types that must not be referenced. The compiler typically
      creates an error marker for accesses to these types.
      </li>
      <li>Discouraged rules define types that should not be referenced. The compiler typically
      creates a warning marker for accesses to these types.
      </li>
      <li>Accessible rules define types that can be referenced.
      </li>

    </ul>Each rule consist of a pattern (same format as ANT patterns) and one of the rule types
    listed above.<br />
    Each classpath entry can have any number of rules defined. The compiler will process the list
    in the order defined and take the first matching rule.<br />
    <br />
    The severity of the problem marker generated for accesses to 'Non-accessible' and 'Discouraged'
    type can be configured on the Java compiler's <a href=
    "../reference/preferences/java/compiler/ref-preferences-errors-warnings.htm">Error/Warnings</a>
    preference page.
      <h3 class="related">Related Concepts</h3>
      <a href="concept-access-rules-combine-rules.htm">Combine Access Rules</a><br />
      <a href="concept-java-builder.htm">Java builder</a><br />
      <a href="concept-classpath-variables.htm">Classpath variable</a><br />
      <a href="concept-inclusion-exclusion-patterns.htm">Inclusion and exclusion patterns</a>

      <h3 class="related">Related References</h3>
      <a href="../reference/ref-properties-build-path.htm">Java build path properties</a><br />
      <a href="../reference/preferences/java/compiler/ref-preferences-errors-warnings.htm">Error/Warnings preference page</a>
  </body>

</html>
